﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TiQuKHBSJ.aspx.cs" Inherits="Web.Pages.YongShui._4.ChaoBiaoKZ.TiQuKHBSJ" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>




<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>提取考核表数据</title>
    <script type="text/javascript" src="../../../JS/jquery.js"></script>
    <script type="text/javascript">
        function AjaxData(index) {
            BtnKHB.SetEnabled(false);
            DrpQK.SetEnabled(false);
            LoadPanel.Show();
            
            ASPxCallback1.PerformCallback("tiqu");
                
           
            
        }
        function Check() {
            txtZhuanHuanJG.SetText("");
            if (DrpQK.GetValue() != "0") {
                HiddenList.Set("glk", DrpQK.GetValue());
            }
            else {
                var lists = $("#glklist").val();
                var arr = lists.split(',');
                HiddenList.Set("glk", lists);
            }
            ASPxCallback1.PerformCallback("check");
        }
        function ASPxCallbackCommonComplete(rs)
        {
           
            var list = rs.split('|');
            var type = list[0];
            var code = list[1];
            var msg = list[2];
            var next = list[3];
            if (type == "check")
            {
               
                if (code == 0) {
                    AjaxData();
                }
                else if (code > 0) {
                    if (confirm("本月已提取过，要再次提取吗？")) {
                        AjaxData();
                    }
                }
                
            }
            else if (type == "tiqu")
            {
                if (code > 0) {
                    var allmsg = txtZhuanHuanJG.GetText();
                    txtZhuanHuanJG.SetText(allmsg + "" + msg);
                    //alert(next);
                    HiddenList.Set("glk", next);
                    if (next == "") {
                        BtnKHB.SetEnabled(true);
                        DrpQK.SetEnabled(true);
                        LoadPanel.Hide();
                    }
                    else {
                        AjaxData();
                    }
                    
                }
                else{
                    alert(msg);
                }
            }
        }
        function ShowDiv()
        {
            LoadPanel.Show();
            return true;
        }
    </script>
     <style type="text/css">
        textarea {
             font-size:16px !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallbackCommonComplete(e.result);}"></dx:ASPxCallback>
        <dx:ASPxHiddenField ID="HiddenList" ClientInstanceName="HiddenList" runat="server"></dx:ASPxHiddenField>
        <asp:HiddenField ID="glklist" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                
                <div class="tabletitle1">
                    提取考核表数据
                </div>
                <table style="">
                    <tr>
                        <td>区块：
                        </td>
                        <td>
                            <dx:ASPxComboBox ID="DrpQK" ClientInstanceName="DrpQK" runat="server" ValueType="System.String"></dx:ASPxComboBox>
                        </td>
                        <td>
                            <dx:ASPxLabel ID="IYIM" runat="server" Text=""></dx:ASPxLabel>

                        </td>
                        <td style="min-width: 150px;" align="right">

                            <dx:ASPxLabel ID="LabNum" runat="server" Text=""></dx:ASPxLabel>
                        </td>
                    </tr>
                </table>
                <fieldset style="border: 1px solid  cornflowerblue;">

                    <dx:ASPxMemo ID="txtZhuanHuanJG" ClientInstanceName="txtZhuanHuanJG" runat="server" Height="450px" Width="100%" ReadOnly="true"></dx:ASPxMemo>

                </fieldset>
                <div style="margin-top: 15px; text-align: right">
                    <dx:ASPxLoadingPanel ID="LoadPanel"  ClientInstanceName="LoadPanel"  runat="server" Text="正在提取..."></dx:ASPxLoadingPanel>

                    <dx:ASPxButton ID="BtnKHB" runat="server" Text="提取考核表数据" ClientInstanceName="BtnKHB" AutoPostBack="false" UseSubmitBehavior="false" >
                        <ClientSideEvents Click="function(s, e) {  
                     Check();
                }" />
                    </dx:ASPxButton>
                    <dx:ASPxButton ID="BtnHGB" runat="server" Text="提取回灌表数据" AutoPostBack="false"  UseSubmitBehavior="false" OnClick="BtnHGB_Click">

                        <ClientSideEvents Click="function(s, e) {  
                     LoadPanel.Show();  
                }" />
                    </dx:ASPxButton>
                </div>

                <div style="display: none">
                    <asp:Button ID="BtnConfirmKHB" runat="server" Text="Button" OnClick="BtnConfirmKHB_Click" OnClientClick="return ShowDiv() " />
                    <asp:Button ID="BtnConfirmHGB" runat="server" Text="Button" OnClick="BtnConfirmHGB_Click" />
                    <asp:HiddenField ID="confirmValue" runat="server" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
